package cn.itcast.account.provider;

import cn.itcast.account.api.AccountClient;
import cn.itcast.account.service.AccountService;
import org.orz.cloud.common.result.ResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 虎哥
 */
@RestController
public class AccountProvider implements AccountClient {
    @Autowired
    private AccountService accountService;

    @Override
    public ResultDTO debit(String userId, Integer money){
        accountService.debit(userId, money);
        return ResultDTO.success();
    }
}
